using System;
using System.Collections.Generic;

class MyQueue
{
    private Stack<string> instack = new Stack<string>();
    private Stack<string> outstack = new Stack<string>();

    // 入队操作
    public void Enqueue(string item)
    {
        instack.Push(item);
    }

    // 出队操作
    public void Dequeue()
    {
        if (outstack.Count == 0)
        {
            try
            {
                while (instack.Count > 0)
                {
                    outstack.Push(instack.Pop());
                }
            }catch (Exception e)
            {
                throw new InvalidOperationException("Queue is empty");
            }
        }
        while (outstack.Count > 0)
        {
            Console.WriteLine(outstack.Pop());
        }
    }
}

class Program
{
    static void Main()
    {
        // 创建队列对象
        MyQueue days = new MyQueue();

        // 入队操作
        days.Enqueue("Sunday");  //入队列 从尾进从头出
        days.Enqueue("Monday");
        days.Enqueue("Tuesdays");
        days.Enqueue("Wednsdaysssssssssss");
        days.Enqueue("Thursdaysssssss");
        days.Enqueue("Fridayssss");
        days.Enqueue("Saturday");

        // 出队操作
        days.Dequeue();

        Console.ReadKey();
    }
}